<template>
	<statusbar-item :tooltip="tooltip" v-if="show" @click="viewWithinFolderFn">
		<i class="iconfont icon-statusbar-wenjianjia center"></i>
	</statusbar-item>
</template>

<script setup lang="ts">
import { computed } from 'vue';
import { showPath } from '@v/utils/ipc';
import { useRootStore } from '@v/store';
import statusbarItem from '@v/components/statusbar/statusbarItem/index.vue';

const store = useRootStore();

const show = computed(() => store.isWork);

const tooltip = computed(() => `在文件夹内查看文档 "${store.filePath}"`);

function viewWithinFolderFn() {
	if (store.filePath) showPath(store.filePath);
}
</script>
